package mobilesearch.receiver;

import java.util.ArrayList;

import android.util.Log;

import mobilesearch.data.AudioData;
import mobilesearch.ui.OnSearchResultListener;

public class AudioReceiver {

	private static final String TAG = "AudioReceiver";
	private ArrayList<AudioData> audioList;
	private OnSearchResultListener listener;
	
	public AudioReceiver(ArrayList<AudioData> audioList, OnSearchResultListener listener) {
		this.audioList = audioList;
		this.listener = listener;
	}
	
	public void processAudioData(){
		int size = this.audioList.size();
		Log.i(TAG, "audio list"+ size);
		for(int i = 0; i < size; i++){
			AudioData data = this.audioList.get(i);
			String name = data.getFileName();
			Log.i(TAG, "name = "+name);
			String artists = data.getArtists();
			Log.i(TAG, "artists = " + artists);
			this.listener.onReceiveAudioData(name, artists);
		}
	}

}
